import { PicEntity } from './pic.entity';
import { Entity, ManyToOne, Column } from 'typeorm';
import { BaseEntity } from './base.entity';

@Entity()
class SpecEntity extends BaseEntity {
  @ManyToOne(
    type => PicEntity,
    picEntity => picEntity.specs,
    {
      onDelete: 'CASCADE',
    },
  )
  pic: PicEntity;
  // 分辨率对应图片地址
  @Column({ type: 'varchar' })
  img_url: string;
  // 分辨率
  @Column({ type: 'varchar' })
  resolution: string;
}

export default SpecEntity;
